<h1>Category
  <div class="float-right">
    <ng-container *permissionLink="['base.framework.category.add']">
      <button [routerLink]="['/framework/category/add']" type="button" class="btn btn-sm btn-primary">
        <i class="fas fa-plus-circle"></i> Add
      </button>
    </ng-container>
    <ng-container *permissionLink="['base.framework.category.edit']">
      <button *ngIf="mode != 2; else listButton" [routerLink]="['/framework/category/edit']" type="button"
              class="btn btn-sm btn-secondary ml-2 text-white">
        <i class="fas fa-edit"></i> Edit
      </button>
    </ng-container>
    <ng-template #listButton>
      <button [routerLink]="['/framework/category/']" type="button" class="btn btn-sm btn-secondary ml-2 text-white">
        <i class="fas fa-list"></i> List
      </button>
    </ng-template>
  </div>
  <div class="clearfix"></div>
</h1>
<hr/>
<div id="category-tree" class="tree-view">
  <cmdb-category-tree [mode]="mode" [tree]="categoryTree"></cmdb-category-tree>
</div>
<div *ngIf="mode == 2;" class="btn-group float-right" role="group">
  <button  type="submit" class="btn btn-success" (click)="onSave()">Update</button>
</div>
<div class="clearfix"></div>

